<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
</head>
<body>
	<h1>Notification</h1>
	<script type="text/javascript">
		(function(){
			Notification.requestPermission(function(result) {
				if (result === 'denied') {
					console.log('Permission wasn\'t granted. Allow a retry.');
					return;
				} else if (result === 'default') {
					console.log('The permission request was dismissed.');
					return;
				}else{
					var title = "测试"
					var dts = Math.floor(Date.now());
					var extra = {
						icon: "/minion.jpg",
						image: "/minion.jpg",
						body: "测试内容",
						timestamp: dts
					}
					var noti = new Notification( title, extra);
					console.log(noti);
					noti.onclick = function(){
						console.log('clicked')
					}
					noti.onclose = function(){
						console.log('closed');
					}
					setTimeout( function() { noti.close() }, 10000)
				}
			});
		}())
	</script>
</body>
</html>